﻿using System;
using System.Data;
using System.Text;

namespace msBsc.WebUi
{
    public partial class mfIndex : msBsc.Cls.mbPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindControls();
            }
        }

        private void BindControls()
        {
            if (!IsPostBack)
            {
            }
        }
        public string GetBrandHtml()
        {
            System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();

            System.Data.DataSet dst = null;
            using (Epm.AppLogic.Framework.CDbAccess oCDbAccess = new Epm.AppLogic.Framework.CDbAccess())
            {
                dst = oCDbAccess.QueryBySQL(@"
	SELECT TOP 24
	BRAND_ID
	,BRAND_NME=BRAND_NME+CASE WHEN ISNULL(BRAND_NME_EN,'')<>'' THEN '/'+ISNULL(BRAND_NME_EN,'') ELSE '' END
	,LOGO_IMG_URL 
	FROM SHP_GOODS_BRAND
	WHERE IS_HOT=1 AND HOT_LEVEL<>'' ORDER BY NEWID() ASC ");
            }

            foreach (DataRow dr in dst.Tables[0].Rows)
            {
                sbHtml.Append(@"<li class=""seckill-item-top""  ""><a href=""/mp_GoodsSearch.htm?b=" + dr["BRAND_ID"].ToString() + @""" class=""seckill-link""> <img width=""100%"" height=""100%"" src=""" + dr["LOGO_IMG_URL"].ToString() + @""" border=""0"" class=""seckill-photo"" /> </a></li>");
            }
            return sbHtml.ToString();
        }

        public override void DoAction()
        {
            if (this.strAction == "loadBrandlistdata")
            {
                //this.ExecJScript("loadSetBrand('" + this.GetParamHtValue("HOT_LEVEL") + "','" + msBsc.AppLogic.Cfg.HttpTools.stringToJson(LoadBrandListContent(this.GetParamHtValue("HOT_LEVEL"), 4).ToString()) + "');");
            }
        }
    }
}